
#include "BallGame.h"

void BallGame::OnKeyDown(SDLKey sym, SDLMod mod, Uint16 unicode){
	
	switch(sym)
	{
		case SDLK_ESCAPE:
			OnExit();
		break;

		case SDLK_LEFT:
			barra.setMoveLeft();
		break;

		case SDLK_RIGHT:
			barra.setMoveRight();
		break;

		case SDLK_SPACE:
			if(!gameOver)
				((CBola*)CEntity::entityList[BOLA_INDEX])->setInGame(true);
		break;
	}
}

void BallGame::OnKeyUp(SDLKey sym, SDLMod mod, Uint16 unicode){
	
	switch(sym)
	{
		case SDLK_LEFT:
			barra.setNoMove();
		break;

		case SDLK_RIGHT:
			barra.setNoMove();
		break;

		case SDLK_SPACE:
			if(gameOver || won)
				resetGame();
		break;

		case SDLK_p:
			paused = !paused;
			pauseText.setVisivel(paused);
		break;

		case SDLK_n:
			level.nextLevel();
		break;

		case SDLK_f:
			//toogleFullScreen();
		break;
	}
}

void BallGame::OnMouseMove(int mX, int mY, int relX, int relY, bool Left,bool Right,bool Middle){
	
	
}